define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'wx.account/index',
        add_url: 'wx.account/add',
        edit_url: 'wx.account/edit',
        delete_url: 'wx.account/delete',
        export_url: 'wx.account/export',
        modify_url: 'wx.account/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},                    {field: 'id', title: 'id'},                    {field: 'wxname', title: '公众号名称'},                    {field: 'app_id', title: 'appId'},                    {field: 'app_secret', title: 'appsecret'},                    {field: 'type', title: '类型 1 普通订阅号2认证订阅号 3普通服务号 4认证服务号/认证媒体/政府订阅号  |'},                    {field: 'status', title: '微信接入状态,0待接入1已接入', templet: ea.table.switch},                    {field: 'web_access_token', title: '网页授权token'},                    {field: 'web_refresh_token', title: 'web_refresh_token'},                    {field: 'web_expiress', title: 'web_expiress'},                    {field: 'create_time', title: 'create_time'},                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});